<?php

Yii::import('application.models._base.BaseUser');

class User extends BaseUser
{
	public $pwd_confirm;
	public $verifyCode;
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('email,pwd,name,verifyCode','required','on'=>'signup'),
			array('email','email'),
			array('pwd_confirm', 'compare', 'compareAttribute'=>'pwd', 'on'=>'signup'),
			array('user_status_id, user_group_id', 'numerical', 'integerOnly'=>true),
			array('email, pwd, name', 'length', 'max'=>255),
			array('created', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, email, pwd, name, user_status_id, user_group_id, created', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'email' => 'Email',
			'pwd' => 'Password',
			'pwd_confirm' => 'Confirm Password',
			'name' => 'Real Name',
			'user_status_id' => 'User Status',
			'user_group_id' => 'User Group',
			'created' => 'Created',
		);
	}
	
}